package observer;

import java.util.LinkedList;
import java.util.List;

public class ConcreteSubject implements Subject{
	private List<Observer> list=new LinkedList<>();
	@Override
	public void add(Observer observer) {
		list.add(observer);
	}

	@Override
	public void remove(Observer observer) {
		list.remove(observer);
	}

	@Override
	public void notify(String str) {
		list.stream().forEach(o->o.update(str));
	}

}
